<?php
namespace app\index\model;

class User extends \think\Model
{
    /**
     * 检查id和姓名是否匹配正确
     * @param $id
     * @param $name
     * @return array|bool|false|\PDOStatement|string|\think\Model
     */
    public function check_user($id, $name)
    {
        if (empty($id) || empty($name)) return false;
        //开始检查id 和 姓名是否匹配
        $user = $this->find($id);

        if (empty($user) || $user['name'] != $name) return false;
        return $user;
    }
}